#!/bin/bash
cd /home/pi
git clone https://gitee.com/wocaa/pi-ip.git
cd pi-ip
sudo cp piip.service /etc/systemd/system/
sudo systemctl enable piip.service

read -p "username: " username
read -p "password: " password

git remote set-url origin https://${username}:${password}@gitee.com/wocaa/pi-ip.git

# test
sudo systemctl start piip.service
